package com.yongcheon.sms_manager.receiver.phone;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;

/**
 * Created by yongcheon on 2014-11-28.
 */
public class PhoneReceiver extends BroadcastReceiver {
    private static final String TAG = "PhoneReceiver";
    public static final int NOTI_ID = 2;


    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i(this.TAG, "PhoneReceiver -> onReceive " + intent);
        TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
        telephony.listen(new PhoneListener(context), PhoneStateListener.LISTEN_CALL_STATE);
    }
}
